/*
 * @Author: lbt666 '1319451895@qq.com'
 * @Date: 2022-07-25 13:54:38
 * @LastEditors: lbt666 1319451895@qq.com
 * @LastEditTime: 2023-05-06 16:08:17
 * @Description: 
 */
import { createWebHistory, createWebHashHistory, createRouter, RouteRecordRaw } from 'vue-router'

// 公共路由
export const constantRoutes: Array<RouteRecordRaw> = [
  {
    path: '/',
    component: () => import('@/views/index/index'),
    name: 'Index',
    meta: { title: 'index', keepAlive: false }
  },
  {
    path: '/property',
    component: () => import('@/views/property'),
    name: 'property',
    meta: { title: 'property', keepAlive: false }
  },
  {
    path: '/blindBox',
    component: () => import('@/views/blindBox'),
    name: 'blindBox',
    meta: { title: 'blindBox', keepAlive: false }
  },
  {
    path: '/Record',
    component: () => import('@/views/Record'),
    name: 'Record',
    meta: { title: 'Record', keepAlive: false }
  },
  {
    path: '/power',
    component: () => import('@/views/power'),
    name: 'power',
    meta: { title: 'power', keepAlive: false }
  },
  {
    path: '/pledge',
    component: () => import('@/views/pledge'),
    name: 'pledge',
    meta: { title: 'pledge', keepAlive: false }
  },
  {
    path: '/my',
    component: () => import('@/views/my'),
    name: 'my',
    meta: { title: 'my', keepAlive: false }
  },
  {
    path: '/Withdrawal',
    component: () => import('@/views/Withdrawal'),
    name: 'Withdrawal',
    meta: { title: 'Withdrawal', keepAlive: false }
  },
  {
    path: '/:pathMatch(.*)*',
    redirect: '/'
  }
]
const router = createRouter({
  history: createWebHashHistory(),
  routes: constantRoutes,
  scrollBehavior(to, from, savedPosition) {
    if (savedPosition) {
      return savedPosition
    } else {
      return { top: 0 }
    }
  },
});
export default router;
